<template>
  <div class="z-dragxml-com z-dragxml-address"
       :class="[zdrag__state_cls()]"
       @mouseenter.stop="zdrag__onMouseEnter">
<!--    {{zdrag__form_config}}-->
    <z-cell-item v-bind="zdrag__form_config"
                 :label="zdrag__GET_CONFIG('ui.label', '')"
                 :desc="zdrag__GET_CONFIG('ui.desc', '')"
                 :hidden-label="zdrag__GET_CONFIG('ui.hiddenLabel', false)"
    >
      <cus-address :ref="zdrag__get_cus_ref" :ui="zdrag__cus_config.ui"></cus-address>
    </z-cell-item>
  </div>
</template>

<script>
import {ZDragCommonMixin} from "@/plugins/z-dragxml/mixins";
import CusAddress from "@/components/CustomForm/CusAddress.vue";
import {createZDragOldComponent} from "@/plugins/z-dragxml/factory";

export default createZDragOldComponent({
  name: 'ZDragAddress',
  components: {CusAddress},
  DRAG_GROUP: 'high',
  ZDragXmlCom: true,
  DRAG_FIELD: true,
  mixins: [
      ZDragCommonMixin
  ],
  DRAG_DATASET() {
    return {
      columnMax: 1
    }
  },
  DRAG_LABEL_XML() {
    return `<div class="z-dragxml-row">
<svg t="1638940155813" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3128" width="16" height="16"><path d="M511.629135 1023.597858c-264.061121 0-475.258836-59.041771-475.258836-156.396716 0-62.624491 77.503749-104.227919 202.423706-130.330596 19.485612-5.227847 38.824991 6.872974 40.360442 25.956444a33.268119 33.268119 0 0 1-26.431703 41.749661c-91.542164 19.229704-146.087255 48.768868-146.087254 62.624491 0 3.436487 5.300964 8.664334 21.167297 19.083471 19.30282 12.210496 47.452767 24.311317 84.44984 34.730453 77.46719 22.519957 186.703606 34.767012 301.058193 34.767012 114.464263 0 221.87276-12.247055 301.094752-34.767012 36.850839-10.419136 65.073902-22.519957 84.413281-34.730453 14.038415-10.419136 19.339379-15.646983 19.339379-19.083471 0-15.646983-59.772938-46.977508-160.12567-66.060978a33.962728 33.962728 0 0 1-28.113388-39.9583 34.36487 34.36487 0 0 1 40.506676-27.747805c133.693966 25.956444 216.462121 69.497465 216.462121 133.767083 0 97.354945-211.197715 156.396715-475.258836 156.396716z m83.31653-193.320671c-17.438343 15.683542-33.01221 28.149946-46.575366 37.070189-18.425419 12.210496-32.463834 17.657694-45.515173 17.657694-12.868547 0-26.94352-5.447197-45.478615-17.657694a410.989218 410.989218 0 0 1-46.575366-37.070189c-36.37558-32.683185-76.077972-75.45648-111.905177-120.642628-55.824634-70.374866-149.596858-206.701035-149.596858-328.111389 0-103.569868 33.779936-198.914102 95.051767-268.375009A328.403856 328.403856 0 0 1 356.511962 30.270332c44.784006-20.107105 93.991574-30.30689 146.343164-30.30689s101.632274 10.199786 146.343163 30.30689a329.061906 329.061906 0 0 1 112.197643 82.877829c61.344948 69.460907 95.015209 164.805141 95.015209 268.375009 0 121.410353-93.735666 257.626848-149.5603 328.111389-35.863763 45.186148-75.566155 88.069118-111.905176 120.642628zM502.855126 63.501892c-170.21578 0-289.213281 130.69618-289.213281 317.911603 0 72.166226 46.831275 174.090968 128.575794 279.488754 32.207926 41.493752 68.473831 81.817637 102.217208 113.367512 31.074616 29.027347 50.194645 41.639986 58.274045 45.844198 8.152517-4.204213 27.235987-16.816851 58.310603-45.844198a995.557587 995.557587 0 0 0 102.253767-113.367512c81.74452-105.397787 128.539236-207.322528 128.539236-279.488754 0.255909-187.215423-118.631917-317.911603-288.957372-317.911603z m0 455.480757a172.482399 172.482399 0 0 1-121.849054-49.755944 168.058836 168.058836 0 0 1-50.413995-120.277044c0-45.442056 17.950161-88.178793 50.413995-120.240486a172.336166 172.336166 0 0 1 121.849054-49.792502c46.063549 0 89.348661 17.694252 121.849054 49.792502a167.802928 167.802928 0 0 1 50.413995 120.240486c0 45.442056-17.913602 88.215352-50.413995 120.277044a172.189932 172.189932 0 0 1-121.849054 49.755944z m0-276.564084c-59.443913 0-107.774081 47.745234-107.774081 106.421421s48.330168 106.384863 107.774081 106.384862 107.810639-47.708675 107.810639-106.384862c0-58.676187-48.220493-106.421421-107.810639-106.421421z" fill="" p-id="3129"></path></svg>
<div class="z-dragxml-label__name">地址</div>
</div>`
  },
  data() {
    return {
      id: ZY.rid(6),
      ui: {
        label: '地址',
        hiddenLabel: false,
        widgetConfig: {
        }
      }
    }
  },
  methods: {
    DRAG_CONFIG() {
      let obj = CusAddress.CUS_EDITOR() ?? { props: {} }
      // Reflect.deleteProperty(obj.props, 'type')
      return obj
      // return {}
    },
  }
}, {
  DRAG_EXPORT() {
    return {
      INIT_CONFIG: {
        type: 'string',
      },
      ui: {
        widget: 'CusAddress'
      }
    }
  },
})
</script>
